home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 2: CDPD 1
/
Almathera Ten on Ten - Disc 2: CDPD 1.iso
/
pd
/
151-175
/
160
/
dwip
/
dwip.doc
< prev
next >
Wrap
Text File
|
1995-03-13
|
14KB
|
271 lines
USER'S GUIDE TO DWIP
====================
by Ken Van Camp (March 1988)
Digitized Data Display Systems
P.O. Box 878
Marshalls Creek, PA 18335-0878
Placed in the public domain by the author.
ACKNOWLEDGEMENT: DWIP is heavily based on the jiff and plop programs by
Jim Kent. Many thanks to Jim for writing a well-documented IFF file
reader/displayer. This program would have taken me months to write
without his code, instead of the two days that it actually took.
INTRODUCTION:
DWIP stands for "Daisy Wheel IFF Printer", and it is intended as a
general-purpose IFF file printing utility for Amiga users who either
(1) want to do graphics on their daisy wheel printer; or (2) just want
to quickly make very large dumps of their IFF files.
While it is true that most screen dump utilities will allow the user
to blow up his image as large as he likes, it is generally impractical
to blow up images to a very large size because of the time involved
(not to mention expense in printer ribbons and wear&tear on your printer).
I wrote DWIP because I wanted to create large banners quickly of files I
had created on my Amiga. (Note that I use the word "quickly" in a relative
sense. I think DWIP is about as quick as you can possibly get in making
screen dumps with standard printers, but it still takes awhile to print
a screen.)
First, the good news: DWIP works with just about ANY printer. It
just uses standard text characters, overstriking them in varying amounts
to make different shades of grey. It does overstriking by first sending
one entire line of characters, then a carriage return code (CR), followed
by another line of characters and another until the desired darkness is
achieved (up to 5 passes for the darkest shade). It only sends a line
feed code (LF) when it is done with all passes over a given line. This
is in keeping with the way the Amiga operates, sending out only a LF at
the end of a line, which returns the carriage to its home position and
also moves the roller forward one line.
In normal operation, the Amiga doesn't use the CR at all, but most
printers use the CR only to return the carriage without moving the
roller. However, some will move the roller as well when they get a CR,
and in that case DWIP will not work properly with the default settings.
Here's what you should do to test DWIP: There is a "test" mode, which you
invoke by typing:
DWIP -z
This will produce a file starting with the letters DW and having four
more characters after that, in your RAM: directory. You can print that
file on your printer, as in:
copy RAM:filename to prt:
What you should see is five lines, each one having 36 characters in it.
(Actually, there are many more characters than that, but the ones toward
the left should be overstruck to produce dark rectangles over the letter
positions.) The five lines should all be identical and single-spaced,
and they should look nearly black on the left and nearly white on the
right. This is the DWIP grey-scale.
If your test pattern doesn't look like this, chances are you're
looking at about 25 lines of output instead of 5. In that case, your
printer is moving the roller with every carriage return code. I would
recommend checking your printer manual at this point, and see if there
is a dip switch that controls the treatment of carriage returns. Disabling
automatic linefeeds with every carriage return should make DWIP work
properly, without affecting the normal operation of your printer with the
Amiga. If you can't find such a dip switch on your printer, or if moving
it affects your other printing with the Amiga, then there is one other
possibility. There is a "universal printer" option on DWIP (-u) which
you can try. It works by sending a bunch of backspaces at the end of
each line, instead of a CR, so there's a chance this might work with your
printer. (Actually, this option isn't as universal as I had intended,
since some printers don't seem to backspace a full character width and
the result is a real mess.) To try this option, use:
DWIP -z -u
and then use the copy command to print out the resulting file. (It will
have a different name from the first one.) And if this doesn't give the
5-line test pattern I described above, you're out of luck. DWIP doesn't
work with your printer.
Now on to continue with the good news:
A dot matrix printer will work just as well as a daisy wheel
printer. I named DWIP for daisy wheels because this is the only graphics
printing utility I know of for the Amiga that also works on daisy wheel
printers.
Also in the realm of good news, I'll tell you that DWIP has many
options, allowing you to print any part of the screen on printers of
any carriage width, either normal or sideways. It can even be used as
a quick-and-dirty slide-show program (although it doesn't do fancy things
like scrolls, fades or dissolves).
Finally, DWIP can blow up a picture as large as you like, including
generating more than one character on your printer per dot on the screen.
That means you can make some very large banners from your IFF files,
although of course you'll have to do some pasting as soon as you go
beyond the width of your printer. (However, DWIP has a sideways printing
option so you can print very long images in a single pass.)
Now for the bad news: First of all, DWIP doesn't do color. It
approximates the colors of the screen as shades of grey (you have control
over that, too).
Second, DWIP doesn't currently support all the IFF file formats. It
is limited to low-resolution, non-HAM screens. (No interlace, overscan,
PAL, high-resolution, or HAM files will work.) Third, it doesn't run from
the workbench; you have to run it from the CLI.
USING DWIP
==========
The format for starting DWIP from the CLI is as follows:
DWIP [options] files
There are many options in DWIP, and any or all may be used in combination.
All options consist of a minus sign (-) and a one-letter code. In addition,
many codes are followed by a number (annotated as "val" below) or a
string of characters (annotated as "string" below). Here is a summary of
all the options:
-lval set leftmost location on screen (default 0)
-tval set top location on screen (default 0)
-wval set width of screen area to print (default 320)
-hval set height of screen area to print (default 200)
-pval set printer pitch (default 10)
-cval set # columns to use across printer (default 135)
-nval set # lines per inch on printer (default 6)
-istring set initialization string (default is none)
-estring set end-of-line string (default is newline)
-u "universal" printer option (use backspaces instead of CR)
-ofile send output to named file (default is PRT:)
-s print sideways
-m "modified" picture (inverse intensity)
-rval set red relative intensity (default 1.0)
-gval set green relative intensity (default 0.7)
-bval set blue relative intensity (default 1.0)
-vtime view file for time seconds, instead of printing
-z print a test pattern (after any named files)
The default for DWIP is to make a copy of the entire screen on the printer
using 135 columns (standard wide-carriage printer in 10-pitch). To zoom
in on a smaller portion of the screen, you have to specify the coordinates
of the left, top corner of the area you want, as well as the width and
height of the area. For instance, if you wanted to print an area beginning
110 dots (pixels) in from the left edge of the screen, 200 dots wide,
and beginning 50 dots from the top edge of the screen, 100 dots high,
of an IFF file named "myfile", you would start DWIP with the command:
DWIP -l110 -w200 -t50 -h100 myfile
DWIP IS case-sensitive, so be sure to use lower-case letters on the options.
File names are the same as standard AmigaDOS, so case doesn't matter there.
To complicate matters, let's say you only have an 80-column printer.
Then you would have to use the -c parameter to set the number of columns,
as in:
DWIP -l110 -w200 -t50 -h100 -c80 myfile
Or suppose your printer prints in 12 pitch, instead of 10 (which DWIP
assumes). You can specify the pitch with the -p parameter, as in: -p12
Or suppose your printer had a compressed printing mode that let you
put 120 characters across a standard 8" printing area. Then you'd need
the -c parameter (-c120), but you'd also need to change the pitch. Pitch
is just the number of characters per inch, so you have 120 / 8 = 15.
You can also change the vertical pitch (the number of lines per inch)
with the -n parameter. The default is 6 (as in 66 lines / 11 inches),
the standard for nearly all printers, but you can easily change this.
You will notice that although DWIP gives you direct control over the
width of the picture you will produce (via the -c parameter), you do not
have control over the length of the picture produced. DWIP automatically
selects a picture length to keep the aspect ratio of the screen as nearly
as possible.
The output file name DWIP chooses is intended to be a "unique" name.
So it makes up a name that doesn't already exist in the RAM: directory
and uses that. If you use DWIP several times, you have to be careful
to delete these files or they'll pile up because DWIP never overwrites
these files. The alternative is for you to explicitly tell DWIP the file
name you'd like your output to go to. Use the -o option, and you can
send the file anywhere you like. For instance, you can send the output
to a file call "myoutput" on your hard drive with a command like:
DWIP -odh0:myoutput [options] myfile
You can even specify "prt:" as the output file, and then Dwip will
automatically print it for you and you can skip the intermediate-file
step. I don't really recommend this, however, since you can't stop
Dwip once it starts printing. This is true if you try to stop it, or
if your printer goes offline and the familiar "Printer Trouble" requester
appears.
Since Dwip itself is pretty fast, and the only slow step is the
actual printing, you may want to do that step in the background, as in:
run c:copy RAM:file to prt:
By using the 'run' command, you can then go on and do other things
while the file is printed.
DWIP prints color pictures by estimating the brightness of each
different color. The basic idea is to add the red, green and blue
components of the color. This would yield a number in the range from
0 (black) to 45 (white) since each of the RGB components has a range
from 0 to 15. However, I have made the observation that the green
color on the Amiga is somewhat lighter than the red or the blue. You
can see this very easily in Preferences by creating a screen with full
green color and no red or blue, and comparing it to the corresponding
red and blue full colors. Therefore, I call the red and blue "full
darkness" colors, but green is only about 70% as dark. Note that I
speak of darkness, not lightness. That's because DWIP starts with a
white sheet of paper and adds darkness to the dots to create a picture.
If you disagree with my choices, you can easily change them yourself.
The -r, -g and -b parameters allow you to enter a decimal number (between
0 and 1) corresponding to the percentage of darkness for each component.
The default is 100% (1.0) for red and blue, and 70% (0.7) for green.
To give equal weighting to all three colors, just use -g1. You can
effectively darken the entire picture by setting numbers slightly greater
than 1 for the 3 parameters, or lighten it by using numbers less than 1
(but never less than 0).
By default, DWIP sends no initialization string to the printer and
only a linefeed character at the end of each line. You can change each
of these, to suit the needs of your printer. For instance, you may want
your printer to do a form feed before each picture, or you may want it
to send an escape code to change the printer pitch. The format for
specifying an initialization string is -istring where "string" is any
string of characters. You can embed non-printing ASCII codes by
specifying them in the form \nnn where nnn is a 3-digit decimal number
for the ASCII code. (NOTE, C programmers, that even with a leading zero
this number is decimal, NOT octal!) For instance, you can tell DWIP to
send a form feed (ASCII code 12) before every picture by using:
DWIP -i\012 myfile
Note that all three digits (012) must be specified. Or if you need to
send an escape, left-bracket ([), and 't' you would use:
DWIP -i\027[t myfile
You can set the end-of-line code sent by DWIP in the same manner.
By default, DWIP sends only a linefeed code (ASCII 10), but with the -e
option you can specify any string you like. Note that here I am talking
about what DWIP does AFTER all overstriking is complete; only the -u
option discussed above affects what is done DURING overstriking.
You can print sideways by using the -s flag, or you can "invert" the
image with the -m (modify) flag. By "invert", I mean printing the
negative of the image, exchanging dark for light as in a photo negative.
(This option really should have been flagged as -i or -n, but both of
those letters were already being used for other options, so I was stuck
with -m. Such are the perils of the English language. :<] )
Finally, if you use the -v option you can make DWIP act like a simple
slideshow utility. The number after the v is the number of seconds to
pause before bringing up the next picture. For instance:
DWIP -v10 file1 file2 file3
would display each of the 3 files in succession, pausing 10 seconds
between each one. This option stops any printing from being done at
all; it is strictly for viewing files.
One final note: all parameters to DWIP are order-dependent; they
are evaluated as they are encountered, and can be placed in whatever
order is logical for your situation. You can set and reset parameters
in a single command line. For instance, you could do something like:
DWIP -l20 -w200 -c80 -ofilout1 myfile1 -l120 -t100 -ofilout2 myfile2
This would use two different output files, with the picture for myfile1
being sent to filout1 and the picture for myfile2 sent to filout2. The
-s and -m parameters are toggles, incidentally. Using them once in a
command turns the option on; using them again turns them off, and so on.
Happy printing! (:<)